Procedural Content Generation for C++ Game Development by Dale Green

Procedural Content Generation for C++ Game Development by Dale Green

Author:Dale Green
Language: eng
Format: mobi
Publisher: Packt Publishing
Published: 2016-01-29T23:00:00+00:00


Load the default helmet texture

Edit the color using the tierColor variable that we set earlier

Draw the modified armor texture in the armorTextures array

We need to do this for every animation that the enemy has. So, we will encapsulate armorTextures array within a for loop, iterating over each value of the ANIMATION_STATE enumerator, as follows:

// Render helmet to armor texture.

for (int i = 0; i < static_cast<int>(ANIMATION_STATE::COUNT); ++i)

{

// Load the default helmet texture and set its color.

sf::Sprite tempSprite;

tempSprite.setTexture(TextureManager::GetTexture(defaultHelmetTextureIDs[i]));

tempSprite.setColor(tierColor);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.